import instance from "@/utils/request"
// 获取权限列表
export const getPermissionList = (params) => {
    return instance({
        url: "/sys/permission",
        method: "get",
        params
    })
}
// 获取用户信息
export const getUserInfo = () => {
    return instance({
        url: "/sys/profile",
        method: "get"
    })
}

// 获取权限详情
export const getPermissionDetail = (id) => {
    return instance({
        url: `/sys/permission/${id}`,
        method: "get"
    })
}

// 添加权限
export const addPermission = (data) => {
    return instance({
        url: "/sys/permission",
        method: "post",
        data
    })
}

// 修改权限
export const updatePermission = (id,data) => {
    return instance({
        url: `/sys/permission/${id}`,
        method: "put",
        data
    })
}
// 删除
export const deletePermission = (id) => {
    return instance({
        url: `/sys/permission/${id}`,
        method: "delete"
    })
}